package com.xyzm.demo.common;

public class Result<T> {
	private boolean success;
	private T data;
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}
	public Result(boolean success, T data) {
		super();
		this.success = success;
		this.data = data;
	}
	public static <T> Result ok() {
		return new Result<T>(true, null);
	}
	public static <T> Result ok(T data) {
		return new Result<T>(true, data);
	}
	public static <T> Result fail() {
		return new Result<T>(false, null);
	}
	public static <T> Result fail(T data) {
		return new Result<T>(false, data);
	}
	

}
